package com.ieheima.demo;

import java.io.*;

public class ObjectClass01 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        User user = new User("zhangsan","123456");
        ObjectOutputStream oos = new ObjectOutputStream(
                new FileOutputStream("day13\\c.txt"));
        oos.writeObject(user);
        oos.close();

        ObjectInputStream ois = new ObjectInputStream(
                new FileInputStream("day13\\c.txt"));
        User o = (User) ois.readObject();
        System.out.println(o);
        ois.close();
    }
}
